//
//  SeasonCell.m
//  趣·美食
//
//  Created by dllo on 15/9/29.
//  Copyright (c) 2015年 金旭. All rights reserved.
//

#import "SeasonCell.h"


@interface SeasonCell ()

@property (nonatomic, strong) UIImageView *titleImage;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *subLabel;


@end

@implementation SeasonCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.titleImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.titleImage];

        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];

        
        self.subLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.subLabel];
 
        
        NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
        

        
    }
    
    return self;
}


- (void)setClassModel:(GFClassifyModel *)classModel {
    if (_classModel != classModel) {

        _classModel = classModel;
    }
    
    NSArray *arr = @[@"春", @"夏", @"秋", @"冬"];
    
    self.nameLabel.text = self.classModel.name;
    
    self.subLabel.text = self.classModel.descri;
    
    self.titleImage.image = [UIImage imageNamed:[arr objectAtIndex:self.rowNumber]];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.titleImage.frame = CGRectMake(ScreenWidth / 375 * 10, ScreenWidth / 375 * 10, ScreenWidth / 375 * 50, ScreenWidth / 375 * 50);
    
    self.nameLabel.frame = CGRectMake(ScreenWidth / 375 * 70, ScreenWidth / 375 * 10, ScreenWidth / 375 * 100, ScreenWidth / 375 * 20);
    
    self.subLabel.frame = CGRectMake(ScreenWidth / 375 * 70, ScreenWidth / 375 * 40, ScreenWidth / 375 * 200, ScreenWidth / 375 * 20);
    self.subLabel.font = [UIFont systemFontOfSize:15];
    self.subLabel.textColor = [UIColor lightGrayColor];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
